import { require} from "@/modules/axios"
import {useStore} from "@/store"
export function login(username,password){
	const store=useStore()
	// console.log("store:",store);
	return require.post("/login",{username,password}).then(({data})=>{
		if(data.code===0){
			store.login(Object.assign(data,{username}))
		}
		return data
	})
}